package dobest.ray.com.jiongjiong.activity;

import android.content.Context;

import dobest.ray.com.jiongjiong.bean.Page;
import dobest.ray.com.jiongjiong.bean.PresenterData;
import dobest.ray.com.jiongjiong.callback.PresenterCallBack;

/**
 * @author wangl01 主呈现者（mvp中的P） 在各个模块逻辑中可以继承此类 空接口，仅代表此类是presenter
 */
public abstract class Presenter {
    protected PresenterCallBack callback;
    protected Page currentPage;
    protected Context context;

    protected void setPresenterCallback(PresenterCallBack callback) {
        this.callback = callback;
    }

    protected <T> void sendData(PresenterData<T> data) {
        if (callback != null) {
            callback.callBackPresenter(data);
        }
    }
}
